package com.pigdogbay.androidutils.mvp;

import com.pigdogbay.androidutils.R;
import com.pigdogbay.androidutils.utils.PreferencesHelper;


public class AdModel implements IAdModel{

	private long _GracePeriod = AdPresenter.AD_FREE_GRACE_PERIOD_IN_MILLIS;
	PreferencesHelper _PreferencesHelper;
	public AdModel(PreferencesHelper prefHelper)
	{
		_PreferencesHelper = prefHelper;
	}
	@Override
	public boolean getDisableAds()
	{
		return _PreferencesHelper.getBoolean(R.string.code_pref_disable_ads_key, false);
	}
	public void setDisableAds(boolean disable)
	{
		_PreferencesHelper.setBoolean(R.string.code_pref_disable_ads_key,disable);
	}
	@Override
	public long getPurchaseDate() {
		return _PreferencesHelper.getLong(R.string.code_pref_purchase_date,0L);
	}

	@Override
	public void setPurchaseDate(long purchaseDate) {
		_PreferencesHelper.setLong(R.string.code_pref_purchase_date, purchaseDate);
	}
	@Override
	public long getGracePeriod() {
		return _GracePeriod;
	}
	@Override
	public void setGracePeriod(long periodInMillis) {
		_GracePeriod = periodInMillis;
	}

}
